(function(){const o=document.querySelectorAll('[class*="track-"], [class*="atomicat-track-"]'),r=document.body.getAttribute("data-page")?.replace("_","");let e=[],n=0;const s=document.documentElement.scrollHeight-window.innerHeight;let i=new Date;const a=()=>{try{const e=window.location.hostname;return e?.includes("b-cdn.net")||e?.includes("atomicat")||e?.includes("cloudfront.net")}catch(e){console.log(e)}};function t(t){const s="https://apidopro.atomicat-api.com/lytics/save";t.visitorId=d(),t.duration=(new Date-i)/1e3,t.btnClicks=e,t.uid=c(),t.pid=r,t.search=window.location.search,t.pathname=window.location.pathname,t.scrolled=isNaN(n)?0:n,t?.uid&&t?.pid&&!a()&&(navigator&&navigator.sendBeacon?navigator.sendBeacon(s,JSON.stringify(t)):(t.origin=window.location.hostname,fetch(s,{keepalive:!0,method:"POST",mode:"no-cors",headers:{"content-type":"application/json"},body:JSON.stringify(t)})),l())}function c(){try{const e=[...document.querySelectorAll('[class*="a-u-"]')].map(e=>{const t=[...e.classList].find(e=>e.startsWith("a-u-"));return t&&e.dataset.hex?{v:e.dataset.hex,p:+t.replace(/\D+/g,"")}:null}).filter(Boolean).sort((e,t)=>e.p-t.p).map(e=>e.v).join("");if(e)return e}catch{}return document.body.id?.replace("_","")}function l(){e=[]}function d(){try{var e,t=localStorage.getItem("atomicat.host");e=JSON.parse(t).uuid}catch{e=u(),localStorage.setItem("atomicat.host",JSON.stringify({uuid:e}))}return e}function u(){var e=(new Date).getTime(),t=(e*Math.random()*1e5).toString(36)+"-"+e+"-"+(e*Math.random()*1e5).toString(36);return t}function h(t,n){const a=t.target,s=n.classList;let o="";for(let e=0;ee.id==o);i!==-1?e[i].count=e[i].count+1:e.push({id:o,count:1})}function m(){const e=window.pageYOffset||document.documentElement.scrollTop;if(s<=0)n=0;else{const t=e/s*100;n=isNaN(t)?0:Math.max(n,t).toFixed(2)}}function f(){o.forEach(e=>{e.addEventListener("click",t=>h(t,e))}),window.addEventListener("scroll",m),t({action:"viewed"})}document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&t({action:"left",listenerType:"visibilitychange"})}),"onpagehide"in window&&window.addEventListener("pagehide",()=>{t({action:"left",listenerType:"pagehide"})}),"onbeforeunload"in window&&window.addEventListener("beforeunload",e=>{t({action:"left",listenerType:"beforeunload"})}),document.addEventListener("mouseout",function(e){!e.relatedTarget&&e.clientY<=0&&(console.log(`mouseout...`),t({action:"left",listenerType:"mouseout"}))}),f()})()